package com.song.helper.controller;


import com.song.helper.model.WorkTime;
import com.song.helper.service.IWorkTimeService;
import com.stylefeng.guns.core.base.tips.ResultTip;
import com.stylefeng.guns.core.controller.AdminBaseController;
import com.stylefeng.guns.core.shiro.ShiroUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 工作时间表 前端控制器
 * </p>
 *
 * @author stylefeng
 * @since 2017-10-02
 */
@Controller
@RequestMapping("/workTime")
public class WorkTimeController extends AdminBaseController {
	@Autowired
    private IWorkTimeService workTimeService;
    @RequestMapping(value = "/getList.app", method = RequestMethod.POST)
    @ResponseBody
    public ResultTip<WorkTime> getList(@RequestBody Map map){
        ShiroUser user = getShiroUser();
        map.put("create_user",user.getId());
        List<WorkTime> list = workTimeService.selectByMap(map);
        ResultTip<WorkTime> result = new ResultTip<>(list);
        return result;
    }
}
